<?php

			$url=parse_url('http://www.paradise-vegas.com/user/create');
			$host_port = $url['host'].(isset($url['port'])?":".$url['port']:"");
			$host = $url['host'];
			$port = isset($url['port'])?$url['port']:"80";
			$script = $url['path'];
										
			$country=65;
			
			$datetime = gmdate("Y-m-d H:i:s");
			$key = md5('kckhoo'.$datetime.'268194cab5022125a897d29d74ef574d');
			
			$header = "POST $script HTTP/1.1\r\n";
			$header .= "Host: $host_port\r\n";
			$header .= "Content-Type: application/x-www-form-urlencoded\r\n";
			$request = "";
			$request .= "user[user_name]=kckhoo";
			$request .= "&user[currency_id]=5";
			$request .= "&user[city]=a";
			$request .= "&user[address1]=a";
			$request .= "&user[address2]=a";
			$request .= "&user[first_name]=khoo";
			$request .= "&user[last_name]=kak chong";
			$request .= "&user[password]=sk1406847";
			$request .= "&user[password_confirmation]=sk1406847";
			$request .= "&user[state]=1";
			$request .= "&user[user_country_id]=".$country;
			$request .= "&user[cellphone]=601762361991";
			$request .= "&user[zip]=1";
			$request .= "&user[api_time_stamp]=".$datetime;
			$request .= "&user[api_key]=".$key;
			$header .= "Content-length: ".strlen($request)."\r\n";
			$header .= "Connection: close\r\n\r\n";
			
			
			$ch = curl_init();
			//curl_setopt($ch, CURLOPT_COOKIEJAR, "/tmp/cookieFileName");
			curl_setopt($ch, CURLOPT_URL,"http://www.paradise-vegas.com/user/create");
			curl_setopt($ch, CURLOPT_POST, 1);
			curl_setopt($ch, CURLOPT_POSTFIELDS, $request);
			curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);		
			//ob_start();      // prevent any output
			$response = curl_exec ($ch); // execute the curl command
			//ob_end_clean();  // stop preventing output			
			curl_close ($ch);
			unset($ch);			
			//$ch = curl_init();
			//curl_setopt($ch, CURLOPT_RETURNTRANSFER,1);
			//curl_setopt($ch, CURLOPT_COOKIEFILE, "/tmp/cookieFileName");
			//curl_setopt($ch, CURLOPT_URL,"http://www.myterminal.com/list.asp");			
			//$buf2 = curl_exec ($ch);			
			//curl_close ($ch);			
			//echo "<PRE>".htmlentities($response);	
			print_r($response);
			echo "<br>*<br>";
			print_r($response[0]);
			echo "<br>*<br>";
			print_r(count($response));


?>